<?php 
class productsize
{
        private $id;
        private $category_level_2_id;
        private $type_of_size_id;
        private $size_name;
		
        public function get_productsize($id)
        {
                $m_query = "select * from product_size where id='{$id}'";
                $m_sql = mysql_query($m_query);
                if(isset($m_sql) && mysql_num_rows($m_sql)>0)
                {
                        $m_result = mysql_fetch_assoc($m_sql);
                        $this->id = $m_result['id'];
                        $this->category_level_2_id = $m_result['category_level_2_id'];
                        $this->type_of_size_id = $m_result['type_of_size_id'];
                        $this->size_name = $m_result['size_name'];
                }
        }
		
        public function get_id()
        {
                return $this->id;
        }
        
        public function get_category_level_2_id()
        {
                return $this->category_level_2_id;
        }
        
        public function get_type_of_size_id()
        {
                return $this->type_of_size_id;
        }
        
        public function get_size_name()
        {
                return $this->size_name;
        }

        public function set_id($id)
        {
                $this->id = $id;
        }
        
        public function set_category_level_2_id($category_level_2_id)
        {
                $this->category_level_2_id = $category_level_2_id;
        }
        
        public function set_type_of_size_id($type_of_size_id)
        {
                $this->type_of_size_id = $type_of_size_id;
        }
        
        public function set_size_name($size_name)
        {
                $this->size_name = $size_name;
        }
        
        public function create()
        {
                $m_query = "insert into product_size (category_level_2_id,type_of_size_id,size_name)
                                        values ('{$this->category_level_2_id}','{$this->type_of_size_id}','{$this->size_name}')";
                $m_sql = mysql_query($m_query);
                if($m_sql)
                        return true;
                else return false;
        }
        
        public function update()
        {
                $m_query = "update product_size 
                                        set category_level_2_id='{$this->category_level_2_id}',
											type_of_size_id='{$this->type_of_size_id}',
                                            size_name='{$this->size_name}' 
                                        where id={$this->id}";
                $m_sql = mysql_query($m_query);
                if($m_sql)
                        return true;
                else return false;
        }
		
        public function del()
        {
                $m_query = "delete from product_size where id={$this->id}";
                $m_sql = mysql_query($m_query);
                if($m_sql)
                        return true;
                else return false;
        }
}

?>